// 请求响应参数（不包含data）
export interface Result {
  code: string | number;
  message: string;
}

// 请求响应参数（包含data）
export interface ResultData<T = any> extends Result {
  data: T;
}

// 分页响应参数
export interface ResPage<T> {
  list: T[];
  pageNum: number;
  pageSize: number;
  total: number;
}

// 分页请求参数
export interface ReqPage {
  [key: string]: any;
  pageNum: number;
  pageSize: number;
}

// 文件上传模块
export namespace Upload {
  export interface ResFileUrl {
    fileUrl: string;
  }
}

// 登录模块
export namespace Login {
  export interface ReqLoginForm {
    account: string;
    // ip: "string";
    pwd: string;
    sessionId: string;
    // smsCode: "string";
    verCode: string;
  }
  export interface ResLogin {
    callToken: string;
    dataToken: string;
    resultCode: number;
    userName: string;
    account: string;
    token: string;

    postName: string;
    userId: string;
  }
  export interface ResAuthButtons {
    [key: string]: string[];
  }
}

export namespace Home {
  export interface FirstAidInformation {
    list: string[];
    allCarCount: number;
    allTaskCount: number;
    carCount: number;
    doingTaskCount: number;
    personCount: number;
    regisCount: number;
  }
}

// 用户管理模块
export namespace User {
  export interface ReqUserParams extends ReqPage {
    username: string;
    gender: number;
    idCard: string;
    email: string;
    address: string;
    createTime: string[];
    status: number;
    isPage: any;
    keyword: any;
  }
  export interface ResUserList {
    id: string;
    username: string;
    gender: number;
    user: { detail: { age: number } };
    idCard: string;
    email: string;
    address: string;
    createTime: string;
    status: number;
    avatar: string;
    photo: any[];
    children?: ResUserList[];
  }
  export interface ResStatus {
    userLabel: string;
    userValue: number;
  }
  export interface ResGender {
    genderLabel: string;
    genderValue: number;
  }
  export interface ResDepartment {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
  export interface ResRole {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
}

// 系统管理模块
export namespace System {
  export interface ResUserList {
    account: string;
    createTime: string;
    email: string;
    id: number;
    mobile: string;
    password: string;
    postCode: string;
    roleId: number;
    status: number;
    userId: string;
    userName: string;
    userType: string;
  }
  export interface ResPostList {
    createTime: string;
    id: number;
    postCode: string;
    postName: string;
  }
  export interface ResRoleList {
    createTime: string;
    id: number;
    roleMark: string;
    roleName: string;
    routerIds: number[];
    routerList: any[];
  }
  export interface ResDictTypeList {
    createTime: string;
    dictName: string;
    dictType: string;
    remarks: string;
    id: number;
  }
  export interface ResDictList {
    createTime: string;
    dictLabel: string;
    dictType: string;
    dictValue: string | number;
    id: number;
    sort: number;
    remarks: string;
    unit: string;
    param: string;
    maxValue: string;
    minValue: string;
  }

  export interface ResMenuList {
    children: ResMenuList[];
    component: string;
    title: string;
    isKeepAlive: boolean | string;
    childList: ResMenuList[];
    createTime: string;
    hasChildren: number;
    icon: string;
    id: number;
    level: number;
    parentId: number;
    parentIds: string;
    name: string;
    path: string;
    redirect: string;
    sort: number;
    status: number;
  }
}
